//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Drawing
{
    public class PictureLocking : Locking, IOfficeXmlSerializable
    {
        private bool noCrop;

        public bool NoCrop
        {
            get { return noCrop; }
            set { noCrop = value; }
        }

        #region IOfficeXmlSerializable Members

        void IOfficeXmlSerializable.ReadXml(ReadContext context)
        {
            using (var c = context.Read("picLocks"))
            {
                NoCrop = c.GetOptionalBoolean("noCrop", false);
                ReadAttributes(c);
                c.WarnIf("ext");
            }
        }

        void IOfficeXmlSerializable.WriteXml(WriteContext context)
        {
            using (WriteContext c = context.Write("picLocks"))
            {
                c.SetOptionalBoolean("noCrop", NoCrop, false);
                WriteAttributes(c);
                c.WarnIf("ext");
            }
        }

        #endregion
    }
}